﻿<UserControl x:Class="CapstoneProjectAEReader.GUIs.SettingGUI.Setting"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="400" d:DesignWidth="800">
    <UserControl.Resources>
        <Style TargetType="{x:Type Control}" x:Key="baseStyle">
            <Setter Property="FontSize" Value="14" />
            <Setter Property="Foreground" Value="Black" />
        </Style>
        <Style TargetType="{x:Type Control}" x:Key="headStyle">
            <Setter Property="FontSize" Value="18" />
            <Setter Property="Foreground" Value="Black" />
        </Style>
        <!--Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource baseStyle}"/-->
    </UserControl.Resources>
    <Grid x:Name="mainGrid">
        <Grid.Background>
            <RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5">
                <RadialGradientBrush.GradientStops>
                    <GradientStop Color="#FFE9FFFF" Offset="0" />
                    <GradientStop Color="#FFF0FFFE" Offset="0.3" />
                    <GradientStop Color="#FFF4F9FD" Offset="0.6" />
                    <GradientStop Color="#FFE7FFFF" Offset="0.8" />
                    <GradientStop Color="#FFE7FFFF" Offset="0.9" />
                </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
        </Grid.Background>
        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <GroupBox x:Name="gbFont" Margin="8" Padding="12" BorderBrush="Black"
                          Style="{StaticResource headStyle}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="120" />
                            <ColumnDefinition Width="250" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <Label x:Name="lbFontSize" Style="{StaticResource baseStyle}" Grid.Column="0" Grid.Row="0" />
                        <ComboBox x:Name="cbFontSize" Margin="10,4,14,4" Width="200" Style="{StaticResource baseStyle}"
                                  Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left">
                        </ComboBox>
                        <Label x:Name="lbFontType" Height="auto" Grid.Column="0" Grid.Row="1"
                               Style="{StaticResource baseStyle}" />
                        <ComboBox x:Name="cbFontType" Margin="10,4,14,4" Width="200" Grid.Column="1" Grid.Row="1"
                                  HorizontalAlignment="Left" IsSynchronizedWithCurrentItem="True" Style="{StaticResource baseStyle}"
                                  ItemsSource="{Binding Source={x:Static Member=Fonts.SystemFontFamilies}}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock FontFamily="{Binding .}" Text="{Binding Source}" />
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </Grid>
                </GroupBox>
                <GroupBox x:Name="gbDisplay" Margin="8" Padding="12" BorderBrush="Black"
                          Style="{StaticResource headStyle}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="120" />
                            <ColumnDefinition Width="250" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <Label x:Name="lbReadingMode" Height="auto" Grid.Column="0" Grid.Row="0"
                               Style="{StaticResource baseStyle}" />
                        <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0">
                            <RadioButton x:Name="rbDay" Width="auto" IsChecked="True" VerticalAlignment="Center"
                                         Style="{StaticResource baseStyle}" GroupName="readingMode" Margin="4,4,4,4" />
                            <RadioButton x:Name="rbNight" Width="auto" VerticalAlignment="Center"
                                         Style="{StaticResource baseStyle}" GroupName="readingMode" Margin="20,4,4,4" />
                        </StackPanel>
                        <Label x:Name="lbLanguage" Height="auto" Grid.Column="0" Grid.Row="1"
                               Style="{StaticResource baseStyle}" />
                        <ComboBox x:Name="cbLanguage" Width="200" Grid.Column="1" Grid.Row="1"
                                  HorizontalAlignment="Left" Margin="10,4,14,4" Style="{StaticResource baseStyle}">
                            <ComboBoxItem Content="Tiếng Việt" IsSelected="True" />
                            <ComboBoxItem Content="English" />
                        </ComboBox>
                    </Grid>
                </GroupBox>
                <GroupBox x:Name="gbOnlineStorage" Margin="8" Padding="12" BorderBrush="Black"
                          Style="{StaticResource headStyle}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="120" />
                            <ColumnDefinition Width="250" />
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="auto" />
                        </Grid.ColumnDefinitions>

                        <Label x:Name="lbServices" Grid.Column="0" VerticalAlignment="Center"
                               Style="{StaticResource baseStyle}" />
                        <ComboBox x:Name="cbOnlineStorage" Width="200" Grid.Column="1" Height="30"
                                  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,4,14,4" Style="{StaticResource baseStyle}">
                            <ComboBoxItem Content="Google Drive" IsSelected="True" />
                        </ComboBox>
                        <Button Grid.Column="2" Height="48" x:Name="btnUploadButton" Background="Transparent"
                                BorderThickness="0" Margin="8,4,8,4" Click="HandleBtUpload">
                            <Grid>
                                <Image Height="auto">
                                    <Image.Style>
                                        <Style TargetType="{x:Type Image}">
                                            <Setter Property="Source" Value="UploadEBook.png" />
                                            <Style.Triggers>
                                                <DataTrigger
                                                    Binding="{Binding IsMouseOver, ElementName=btnUploadButton}" Value="True">
                                                    <Setter Property="Source" Value="UploadEBookHover.png" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Image.Style>
                                </Image>
                                <Label x:Name="btUpload" HorizontalAlignment="Center" VerticalAlignment="Center"
                                       Margin="10,0,0,0" Style="{StaticResource baseStyle}" />
                            </Grid>
                        </Button>
                        <Button x:Name="btnDownloadButton" Grid.Column="3" Height="46" Background="Transparent"
                                BorderThickness="0" Margin="8,4,4,4" Click="HandleBtDownload">
                            <Grid>
                                <Image Height="auto">
                                    <Image.Style>
                                        <Style TargetType="{x:Type Image}">
                                            <Setter Property="Source" Value="DownloadEBook.png" />
                                            <Style.Triggers>
                                                <DataTrigger
                                                    Binding="{Binding IsMouseOver, ElementName=btnDownloadButton}" Value="True">
                                                    <Setter Property="Source" Value="DownloadEBookHover.png" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Image.Style>
                                </Image>
                                <Label x:Name="btDownload" HorizontalAlignment="Center" VerticalAlignment="Center"
                                       Margin="10,0,0,0" Style="{StaticResource baseStyle}" />
                            </Grid>
                        </Button>
                    </Grid>
                </GroupBox>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="4,4,4,4" HorizontalAlignment="Right" Grid.Row="1">
                <Button x:Name="lbSave" Background="Transparent" Height="40" BorderThickness="0" Margin="4"
                        Click="HandleSaveBt">
                    <Grid>
                        <Image Height="32">
                            <Image.Style>
                                <Style TargetType="{x:Type Image}">
                                    <Setter Property="Source" Value="ButtonLargeAlt.png" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsMouseOver, ElementName=lbSave}" Value="True">
                                            <Setter Property="Source" Value="ButtonLargeAltHover.png" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>
                        </Image>
                        <Label x:Name="btSave" HorizontalAlignment="Center" VerticalAlignment="Center"
                               Style="{StaticResource baseStyle}" />
                    </Grid>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>